const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');

const prodConfig = {
    mode: 'production',
    devtool: "none",
    module: {
        rules: [{
            test: /\.css$/,
            use: [
                MiniCssExtractPlugin.loader,
                'css-loader'
                
            ]
        }
      ]
    },
    optimization:{
        minimizer:[new OptimizeCSSAssetsPlugin()]
    },
    plugins:[
        new MiniCssExtractPlugin({
            filename: '[name].css',
			chunkFilename: '[name].chunk.css'
        })
    ],
    output: {
        filename: '[name].[contenthash].js',
        chunkFilename:'[name].[contenthash].js',
    },
}

module.exports = prodConfig